function manage() {

    //工作人员性别占比
    $(function() {
        $.ajax({
            url: "http://47.99.139.114:9527/scenic/findAllEmploy", //请求地址
            dataType: "json", //数据格式 
            type: "get", //请求方式
            async: true, //是否异步请求
            success: function(data) { //如何发送成功
                console.log(data);

                var myChart = echarts.init($("#userContainerSex")[0]);
                var option = {
                    tooltip: {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    legend: {
                        orient: 'vertical',
                        x: 'left',
                        y: "16",
                        data: ['男性', '女性'],
                        textStyle: {
                            color: "#e9ebee"
                        }
                    },
                    series: [{
                        itemStyle: {
                            normal: {
                                label: {
                                    show: false
                                },
                                labelLine: {
                                    show: false
                                }
                            }
                        },
                        name: '',
                        type: 'pie',
                        radius: '55%',
                        center: ['50%', '60%'],
                        data: [{
                                value: data.totalBoys,
                                name: '男性',
                                itemStyle: {
                                    normal: {
                                        color: "#2865aa"
                                    }
                                }
                            },
                            {
                                value: data.totalGirls,
                                name: '女性',
                                itemStyle: {
                                    normal: {
                                        color: "#ff81cb"
                                    }
                                }
                            }
                        ]
                    }]
                };


                myChart.setOption(option);
                window.addEventListener("resize", function() {
                    myChart.resize();
                });
            }
        })
    })

    // 各部门人员占比
    $(function() {
        $.ajax({
            url: "http://47.99.139.114:9527/scenic/findDepartments", //请求地址
            dataType: "json", //数据格式 
            type: "get", //请求方式
            async: true, //是否异步请求
            success: function(data) { //如何发送成功
                console.log(data);
                var as = [];
                var ac = [];
                for (var j = 0, k = 0, i = 0; i < data.length; i++) {
                    // if (i == 0) {
                    //     ac[i] = data[i]

                    if (i % 2 == 0) {
                        as[k] = data[i]
                        k++;

                    } else if (i % 2 !== 0) {
                        ac[j] = data[i]
                        j++;
                    }
                }
                console.log(ac)
                console.log(as)
                console.log(ac[0])

                var myChart = echarts.init($("#userContainerManage")[0]);
                var option = {
                    tooltip: {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    legend: {
                        x: 'center',
                        y: "16",
                        data: as,
                        textStyle: {
                            color: "#e9ebee"
                        }
                    },
                    series: [{
                        itemStyle: {
                            normal: {
                                label: {
                                    show: false
                                },
                                labelLine: {
                                    show: false
                                }
                            }
                        },
                        name: '',
                        type: 'pie',
                        radius: '55%',
                        center: ['50%', '60%'],
                        data: [{
                                    value: ac[0],
                                    name: as[0],
                                    itemStyle: {
                                        normal: {
                                            color: "#1afffd"
                                        }
                                    }
                                },
                                {
                                    value: ac[1],
                                    name: as[1],
                                    itemStyle: {
                                        normal: {
                                            color: "#2e7cff"
                                        }
                                    }
                                },
                                {
                                    value: ac[2],
                                    name: as[2],
                                    itemStyle: {
                                        normal: {
                                            color: "#ffcb89"
                                        }
                                    }
                                },
                                {
                                    value: ac[3],
                                    name: as[3],
                                    itemStyle: {
                                        normal: {
                                            color: "#005ea1"
                                        }
                                    }
                                },
                                {
                                    value: ac[4],
                                    name: as[4],
                                    itemStyle: {
                                        normal: {
                                            color: "#0ad5ff"
                                        }
                                    }
                                },
                                {
                                    value: ac[5],
                                    name: as[5],
                                    itemStyle: {
                                        normal: {
                                            color: "#feb602"
                                        }
                                    }
                                }

                            ]
                            //data:[
                            //    {value:90, name:'男性',
                            //        itemStyle:{
                            //            normal:{
                            //                color:"#2865aa"
                            //            }
                            //        }},
                            //    {value:10, name:'女性',
                            //        itemStyle:{
                            //            normal:{
                            //                color:"#ff81cb"
                            //            }
                            //        }}
                            //]
                    }]
                };


                myChart.setOption(option);
                window.addEventListener("resize", function() {
                    myChart.resize();
                });
            }
        })
    })

    //工作人员年龄分析
    $(function() {
        $.ajax({
            url: "http://47.99.139.114:9527/scenic/findAgeType", //请求地址
            dataType: "json", //数据格式 
            type: "get", //请求方式
            async: true, //是否异步请求
            success: function(data) { //如何发送成功
                console.log(data);

                var myChart = echarts.init($("#userContainerAge")[0]);
                var option = {
                    tooltip: {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    legend: {
                        orient: 'vertical',
                        x: 'right',
                        y: "16",
                        data: ['少年', '青年', '中年', '老年', '其他'],
                        textStyle: {
                            color: "#e9ebee"
                        }
                    },
                    series: [{
                        itemStyle: {
                            normal: {
                                label: {
                                    show: false
                                },
                                labelLine: {
                                    show: false
                                }
                            }
                        },
                        name: '',
                        type: 'pie',
                        radius: '55%',
                        center: ['50%', '60%'],
                        data: [{
                                value: data[0],
                                name: '少年',
                                itemStyle: {
                                    normal: {
                                        color: "#0ad5ff"
                                    }
                                }
                            },
                            {
                                value: data[1],
                                name: '青年',
                                itemStyle: {
                                    normal: {
                                        color: "#005ea1"
                                    }
                                }
                            },
                            {
                                value: data[2],
                                name: '中年',
                                itemStyle: {
                                    normal: {
                                        color: "#ffcb89"
                                    }
                                }
                            },
                            {
                                value: data[3],
                                name: '老年',
                                itemStyle: {
                                    normal: {
                                        color: "#2e7cff"
                                    }
                                }
                            },
                            {
                                value: data[4],
                                name: '其他',
                                itemStyle: {
                                    normal: {
                                        color: "#1afffd"
                                    }
                                }
                            }
                        ]
                    }]
                };

                myChart.setOption(option);
                window.addEventListener("resize", function() {
                    myChart.resize();
                });
            }
        })
    })

    //景区个部门出勤情况分析
    $(function() {
        var myChart = echarts.init($("#userContainerAttendance")[0]);
        $.ajax({
            url: "http://47.99.139.114:9527/scenic/findAttendance", //请求地址
            dataType: "json", //数据格式 
            type: "get", //请求方式
            async: true, //是否异步请求
            success: function(data) { //如何发送成功


                console.log(data);
                var v = data[0];
                console.log(v);

                var as = [];
                var ac = [];
                for (var j = 0, k = 0, i = 0; i < data.length; i++) {
                    // if (i == 0) {
                    //     ac[i] = data[i]

                    if (i % 2 == 0) {
                        as[k] = data[i]
                        k++;

                    } else if (i % 2 !== 0) {
                        ac[j] = data[i]
                        j++;
                    }
                }
                console.log(ac)
                console.log(as)


                option = {
                        tooltip: {
                            trigger: 'axis',
                            axisPointer: { // 坐标轴指示器，坐标轴触发有效
                                type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                            }
                        },
                        grid: {
                            x: 46,
                            y: 30,
                            x2: 32,
                            y2: 40,
                            borderWidth: 0
                        },
                        calculable: true,
                        xAxis: [{
                            type: 'category',
                            data: as,

                            splitLine: {
                                show: false
                            },
                            axisLabel: {
                                show: true,
                                textStyle: {
                                    color: '#a4a7ab',
                                    align: 'center'
                                }
                            }
                        }],
                        yAxis: [{
                            type: 'value',
                            splitLine: {
                                show: false
                            },
                            axisLabel: {
                                show: true,
                                textStyle: {
                                    color: '#a4a7ab'
                                }
                            }
                        }],
                        series: [{
                            name: '出勤率（%）',
                            type: 'bar',
                            barWidth: '30',
                            data: ac,
                            itemStyle: {
                                normal: {
                                    color: "#1afffd"
                                }
                            }

                        }]
                    },

                    myChart.setOption(option);
                window.addEventListener("resize", function() {
                    myChart.resize();
                });
            }
        })
    })

    //个人出勤率排行
    $(function() {
        var myChart = echarts.init($("#userContainerPersonal")[0]);
        var option = {
            tooltip: {
                trigger: 'axis',
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                    type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                }
            },
            grid: {
                x: 46,
                y: 30,
                x2: 32,
                y2: 40,
                borderWidth: 0
            },
            xAxis: {
                type: 'value',
                x: '180',
                splitLine: {
                    show: false
                },
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: '#a4a7ab'
                    }
                }
            },
            yAxis: {
                type: 'category',
                data: ['陈杰', '李进', '张佳倩', '孙林', '李杰'],
                splitLine: {
                    show: false
                },
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: '#a4a7ab'
                    }
                }
            },
            series: [{
                name: '出勤率（%）',
                type: 'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'insideRight'
                    }
                },
                data: [60, 72, 85, 96, 99],
                itemStyle: {
                    normal: {
                        color: "#45c0ff"
                    }
                }
            }]
        };
        myChart.setOption(option);
    });

    //不同月份人员流动情况
    $(function() {
        var myChart = echarts.init(document.getElementById('userContainerFlow'));
		$.ajax({
		    url: "http://47.99.139.114:9527/scenic/findPorp", //请求地址
		    dataType: "json", //数据格式 
		    type: "get", //请求方式
		    async: true, //是否异步请求
		    success: function(data) {
				var option = {
				    tooltip: {
				        trigger: 'axis'
				    },
				    grid: {
				        x: 46,
				        y: 30,
				        x2: 32,
				        y2: 40,
				        borderWidth: 0
				    },
				    calculable: true,
				    xAxis: [{
				        type: 'category',
				        boundaryGap: false,
				        data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
				        splitLine: {
				            show: false
				        },
				        axisLabel: {
				            show: true,
				            textStyle: {
				                color: '#a4a7ab'
				            }
				        }
				    }],
				    yAxis: [{
				        type: 'value',
				        splitLine: {
				            show: false
				        },
				        axisLabel: {
				            show: true,
				            textStyle: {
				                color: '#a4a7ab'
				            }
				        }
				
				    }],
				    series: [{
				        name: '景区工作人员',
				        type: 'line',
				        stack: '人',
				        data: [data[0],data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8], data[9], data[10], data[11]],
				        itemStyle: {
				            normal: {
				                color: "#1afffd"
				            }
				        }
				    }]
				};
				myChart.setOption(option);
			},
			});
		})
		
		

    //景区个部门违规操作分析
    $(function() {
        var myChart = echarts.init($("#userContainerIllegal")[0]);
        var option = {
            tooltip: {
                trigger: 'axis',
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                    type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                }
            },
            grid: {
                x: 46,
                y: 30,
                x2: 32,
                y2: 40,
                borderWidth: 0
            },
            calculable: true,
            xAxis: [{
                type: 'category',
                data: ['安保部', '售票部', '保洁部', '后勤部', '指导部', '急救部'],

                splitLine: {
                    show: false
                },
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: '#a4a7ab',
                        align: 'center'
                    }
                }
            }],
            yAxis: [{
                type: 'value',
                splitLine: {
                    show: false
                },
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: '#a4a7ab'
                    }
                }
            }],
            series: [{
                name: '违规次数（次）',
                type: 'bar',
                barWidth: '30',
                data: [124, 522, 235, 365, 214, 265, 58, 4, 6, 7, 3, 3, 1],
                itemStyle: {
                    normal: {
                        color: "#269fec"
                    }
                }

            }]
        };
        myChart.setOption(option);
    });

    //不同月份各部门被投诉分析
    $(function() {
        var myChart = echarts.init(document.getElementById('userContainerComplaint'));
        var option = {
            tooltip: {
                trigger: 'axis'
            },
            grid: {
                x: 46,
                y: 30,
                x2: 32,
                y2: 40,
                borderWidth: 0
            },
            calculable: true,
            xAxis: [{
                type: 'category',
                boundaryGap: false,
                data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
                splitLine: {
                    show: false
                },
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: '#a4a7ab'
                    }
                }
            }],
            yAxis: [{
                type: 'value',
                splitLine: {
                    show: false
                },
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: '#a4a7ab'
                    }
                }

            }],
            series: [{
                    name: '安保部',
                    type: 'line',
                    stack: '人',
                    data: [120, 132, 101, 134, 90, 230, 210, 230, 245, 256, 278, 300],
                    itemStyle: {
                        normal: {
                            color: "#45c0ff"
                        }
                    }
                },
                {
                    name: '售票部',
                    type: 'line',
                    stack: '人',
                    data: [220, 182, 191, 234, 290, 330, 310, 230, 245, 256, 278, 300],
                    itemStyle: {
                        normal: {
                            color: "#0ad5ff"
                        }
                    }
                },
                {
                    name: '保洁部',
                    type: 'line',
                    stack: '人',
                    data: [220, 182, 191, 234, 290, 330, 310, 230, 245, 256, 278, 300],
                    itemStyle: {
                        normal: {
                            color: "#005ea1"
                        }
                    }
                },
                {
                    name: '后勤部',
                    type: 'line',
                    stack: '人',
                    data: [220, 182, 191, 234, 290, 330, 310, 230, 245, 256, 278, 300],
                    itemStyle: {
                        normal: {
                            color: "#ffcb89"
                        }
                    }
                },
                {
                    name: '指导部',
                    type: 'line',
                    stack: '人',
                    data: [220, 182, 191, 234, 290, 330, 310, 230, 245, 256, 278, 300],
                    itemStyle: {
                        normal: {
                            color: "#2e7cff"
                        }
                    }
                },
                {
                    name: '急救部',
                    type: 'line',
                    stack: '人',
                    data: [220, 182, 191, 234, 290, 330, 310, 230, 245, 256, 278, 300],
                    itemStyle: {
                        normal: {
                            color: "#1afffd"
                        }
                    }
                }
            ]
        };
        myChart.setOption(option);
    });

    //员工奖惩分析
    $(function() {
        var myChart = echarts.init(document.getElementById('userContainerPrize'));
        var option = {
            tooltip: {
                trigger: 'axis',
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                    type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                }
            },
            //legend: {
            //    data:['散客人数（万人）','团队人数（万人）'],
            //    textStyle: { fontWeight: 'bold', color: '#a4a7ab' }
            //},
            grid: {
                x: 46,
                y: 30,
                x2: 32,
                y2: 40,
                borderWidth: 0
            },
            xAxis: [{
                type: 'category',
                data: ['李杰', '赵一鸣', '陈爽', '李焕', '周伟', '张杰', '王维'],
                splitLine: {
                    show: false
                },
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: '#a4a7ab',
                        align: 'center'
                    }
                }
            }],
            yAxis: [{
                type: 'value',
                splitLine: {
                    show: false
                },
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: '#a4a7ab'
                    }
                }
            }],
            series: [{
                    name: '奖励次数（次）',
                    type: 'bar',
                    data: [5, 7, 4, 1, 2, 9, 6, 5, 7],
                    itemStyle: {
                        normal: {
                            color: "#1afffd"
                        }
                    }
                },
                {
                    name: '惩罚次数（次）',
                    type: 'bar',
                    stack: '广告',
                    data: [2, 1, 4, 9, 7, 5, 2, 7, 6],
                    itemStyle: {
                        normal: {
                            color: "#2e7cff"
                        }
                    }
                }
            ]
        };


        myChart.setOption(option);
    });

    //设备故障原因分析
    $(function() {
        var myChart = echarts.init(document.getElementById('userContainerReason'));
        var option = {
            tooltip: {
                trigger: 'item',
                formatter: "{a} <br/>{b} : {c} ({d}%)"
            },
            legend: {
                orient: 'vertical',
                x: 'left',
                data: ['人为破坏', '年久失修', '自然因素', '设备过期', '其他'],
                textStyle: {
                    color: "#e9ebee"
                }
            },
            series: [{
                name: '故障原因',
                type: 'pie',
                radius: '55%',
                center: ['50%', '60%'],
                data: [{
                        value: 335,
                        name: '人为破坏',
                        itemStyle: {
                            normal: {
                                color: "#1afffd"
                            }
                        }
                    },
                    {
                        value: 310,
                        name: '年久失修',
                        itemStyle: {
                            normal: {
                                color: "#2e7cff"
                            }
                        }
                    },
                    {
                        value: 234,
                        name: '自然因素',
                        itemStyle: {
                            normal: {
                                color: "#ffcb89"
                            }
                        }
                    },
                    {
                        value: 135,
                        name: '设备过期',
                        itemStyle: {
                            normal: {
                                color: "#005ea1"
                            }
                        }
                    },
                    {
                        value: 148,
                        name: '其他',
                        itemStyle: {
                            normal: {
                                color: "#45c0ff"
                            }
                        }
                    }
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }]
        };
        myChart.setOption(option);
    });

    //故障处理情况分析
    $(function() {
        var myChart = echarts.init(document.getElementById('userContainerHandle'));
        var option = {
            tooltip: {
                trigger: 'item',
                formatter: "{a} <br/>{b} : {c} ({d}%)"
            },
            legend: {
                orient: 'vertical',
                x: 'right',
                data: ['已处理', '未处理', '超期未处理', '其他'],
                textStyle: {
                    color: "#e9ebee"
                }
            },
            series: [{
                name: '处理情况',
                type: 'pie',
                radius: '55%',
                center: ['50%', '60%'],
                data: [{
                        value: 335,
                        name: '已处理',
                        itemStyle: {
                            normal: {
                                color: "#2e7cff"
                            }
                        }
                    },
                    {
                        value: 310,
                        name: '未处理',
                        itemStyle: {
                            normal: {
                                color: "#ffcb89"
                            }
                        }
                    },
                    {
                        value: 234,
                        name: '超期未处理',
                        itemStyle: {
                            normal: {
                                color: "#2864ab"
                            }
                        }
                    },
                    {
                        value: 148,
                        name: '其他',
                        itemStyle: {
                            normal: {
                                color: "#e15828"
                            }
                        }
                    }
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }]
        };
        myChart.setOption(option);
    });
}